package cn.com.w.sharding.config;

import java.io.*;

public class T {


    public static void main(String[] args) throws Exception {


        File file = new File("/Users/zhangxiaolong/Desktop/user_info.sql");
        InputStream inputStream = new FileInputStream(file);
        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));

        String tmp = null;
        while ((tmp = reader.readLine()) != null) {
            System.out.println(tmp);
            //close(null, reader);
        }


    }

    /**
     * 关闭命令
     *
     * @param process
     * @param bufferedReader
     * @throws IOException
     */
    public static void close(Process process, BufferedReader bufferedReader) throws IOException {
        if (bufferedReader != null) {
            try {
                bufferedReader.close();
            } catch (IOException e) {
                throw new RuntimeException("BufferedReader.close()异常。" + e);
            }
        }
        if (process != null) {
            try {
                process.destroy();
                process = null;
            } catch (Exception e) {
                throw new RuntimeException("Process.destroy()异常。" + e);
            }
        }
    }
}
